package com.zjw.zy.viewmodel

import androidx.lifecycle.LiveData
import androidx.lifecycle.MediatorLiveData
import com.zjw.zy.base.BaseViewModel
import com.zjw.zy.bean.UIMode
import com.zjw.zy.ext.requireService
import remotecall.RemoteCallManager

/**
 * @author     ：zhong.jw
 * @date       ：Created in 2022/12/2 16:59
 * @description：
 */
class AppViewModel : BaseViewModel() {

    private val mAppUIMode = MediatorLiveData<UIMode>()
    fun getAppUIMode(): LiveData<UIMode> = mAppUIMode

    fun requestUIMode() {
        requireService()?.requestAppUIMode(RemoteCallManager.defaultImpl().remoteCall<UIMode> {
            mAppUIMode.postValue(it)
        })
    }
}